/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * formalStuInfoUI.java
 *
 * Created on 2011-5-7, 23:28:32
 */
package junchangmis.student;

import java.io.IOException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import jxl.write.WriteException;
import publicmethod.*;
import junchangmis.*;
import java.util.StringTokenizer;
import java.util.Vector;
import javax.swing.*;
import java.sql.ResultSet;
import junchangmis.codecSetting.*;

/**
 *
 * @author developers
 */
public class formalStuInputUI extends javax.swing.JDialog {

    formalStu student;
    newToFormalUI parent = null;
    MainFrame parentOther = null;

    /** Creates new form formalStuInfoUI */
    public formalStuInputUI(java.awt.Frame parent, boolean modal, formalStu student, newToFormalUI pparent) {//录入时的构造函数
        super(parent, modal);
        this.student = student;
        this.parent = pparent;
        initComponents();
        this.jButtonConfirm.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAddActionPerformed(evt);
            }
        });
        this.jButtonJustExit.setVisible(false);
        initExistInfo();
        this.setLocationRelativeTo(null);
        this.setTitle("正式生信息录入");
    }

    public formalStuInputUI(java.awt.Frame parent, boolean modal, newToFormalUI pparent, formalStu student) {//通过newToFromal进入查询时的构造函数
        super(parent, modal);
        this.student = student;
        this.parent = pparent;
        initComponents();
        this.jButtonConfirm.setText("修改而关闭");
        this.jLabelTitle.setText("正式生生信息查询与修改");
        this.jButtonConfirm.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonInquireAndEditActionPerformed(evt);
            }
        });
        this.jButtonJustExit.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonJustExitActionPerformed(evt);
            }
        });
        initFullInfo();
        this.setLocationRelativeTo(null);
        this.setTitle("正式生信息查询与修改");
    }

    public formalStuInputUI(java.awt.Frame parent, boolean modal, MainFrame pparent, formalStu student) {//通过MainFrame进入查询时的构造函数
        super(parent, modal);
        this.student = student;
        this.parentOther = pparent;
        initComponents();
        this.jButtonConfirm.setText("修改而关闭");
        this.jLabelTitle.setText("正式生生信息查询与修改");
        this.jButtonConfirm.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonInquireAndEditActionPerformed(evt);
            }
        });
        this.jButtonJustExit.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonJustExitActionPerformed(evt);
            }
        });
        initFullInfo();
        this.setLocationRelativeTo(null);
        this.setTitle("正式生信息查询与修改");

    }
    
    private void jButtonInquireAndEditActionPerformed(java.awt.event.ActionEvent evt) {//查询--修改时的按钮消息
        //现根据student进行查询，然后根据控件上的各个值进行update
        if (student.id.equals(this.jTextFieldId.getText()) == false)//如果修改了id
        {
            if (this.jTextFieldId.getText().length() != 9 || formalStuInputMethod.isNumeric(this.jTextFieldId.getText().substring(7)) == false) {
                JOptionPane.showConfirmDialog(null, "学生编码格式错误！", "提示", JOptionPane.CLOSED_OPTION, JOptionPane.WARNING_MESSAGE);
                this.jTextFieldId.setSelectionStart(0);
            } else {
                String codeTriple = codecMethodNew.getMeaning(this.jTextFieldId.getText().substring(0, 7));//获得总编码的翻译结果
                if (codeTriple == null) {
                    JOptionPane.showConfirmDialog(null, "不存在该专业班级编码！", "提示", JOptionPane.CLOSED_OPTION, JOptionPane.WARNING_MESSAGE);
                    this.jTextFieldId.setSelectionStart(0);
                } else {
                    if (stuChooseMethod.hasFormalStu(this.jTextFieldId.getText()) == false) {
                        try {
                            //查询--修改时的按钮消息
                            //现根据student进行查询，然后根据控件上的各个值进行update
                            DbOperation db = new DbOperation();
                            db.DbConnect();
                            String sql = "select * from formalStu where id='" + student.id + "'";
                            ResultSet rs = db.DBSqlQuery(sql);
                            if (rs.next()) {
                                //转班操作 自行输入新编码 通过生成交费统计表人工查找剩余可分配的学号编码
                                rs.updateString("id", this.jTextFieldId.getText());
                                rs.updateString("classCode", this.jTextFieldId.getText().substring(0, 7));

                                rs.updateString("name", this.jTextFieldName.getText());
                                rs.updateString("sex", this.jComboBoxSex.getSelectedItem().toString());
                                rs.updateString("birthday", this.jComboBoxYear.getSelectedItem().toString() + "."
                                        + this.jComboBoxMonth.getSelectedItem().toString() + "."
                                        + this.jComboBoxDay.getSelectedItem().toString());
                                rs.updateString("tel", this.jTextFieldTel.getText());
                                rs.updateString("school", this.jTextFieldSchool.getText());
                                rs.updateString("weekCount", this.jTextFieldWeekCount.getText());
                                rs.updateString("dateStart", this.jComboBoxYearStart.getSelectedItem().toString() + "."
                                        + this.jComboBoxMonthStart.getSelectedItem().toString() + "."
                                        + this.jComboBoxDayStart.getSelectedItem().toString());
                                rs.updateString("coursePerWeek", this.jTextFieldCoursePerWeek.getText());
                                rs.updateString("pricePerCourse", this.jTextFieldPricePerCourse.getText());
                                rs.updateString("tuition", this.jTextFieldTuition.getText());
                                rs.updateString("bookFee", this.jTextFieldBookFee.getText());
                                rs.updateString("costumeFee", this.jTextFieldCostumeFee.getText());
                                rs.updateString("otherFee", this.jTextFieldOtherFee.getText());
                                rs.updateString("sumFee", this.jTextFieldSumFee.getText());

                                rs.updateRow();

                                JOptionPane.showConfirmDialog(null, "修改成功！", "提示", JOptionPane.CLOSED_OPTION, JOptionPane.INFORMATION_MESSAGE);

                                if (this.parent != null) {//如果父窗口是newToFormal 则需更新右侧列表
                                    parent.updateRight();
                                }
                                dispose();
                            }
                        } catch (SQLException ex) {
                            Logger.getLogger(formalStuInputUI.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    } else {
                        JOptionPane.showConfirmDialog(null, "已存在该学生编码的学生！", "提示", JOptionPane.CLOSED_OPTION, JOptionPane.WARNING_MESSAGE);
                        this.jTextFieldId.setSelectionStart(0);
                    }
                }
            }
        } else {//如果没有修改id
            try {
                //查询--修改时的按钮消息
                //现根据student进行查询，然后根据控件上的各个值进行update
                DbOperation db = new DbOperation();
                db.DbConnect();
                String sql = "select * from formalStu where id='" + student.id + "'";
                ResultSet rs = db.DBSqlQuery(sql);
                if (rs.next()) {
                    // rs.updateString("id", this.jTextFieldId.getText());
                    //  rs.updateString("classCode", this.jTextFieldId.getText().substring(0, 6));
                    rs.updateString("name", this.jTextFieldName.getText());
                    rs.updateString("sex", this.jComboBoxSex.getSelectedItem().toString());
                    rs.updateString("birthday", this.jComboBoxYear.getSelectedItem().toString() + "."
                            + this.jComboBoxMonth.getSelectedItem().toString() + "."
                            + this.jComboBoxDay.getSelectedItem().toString());
                    rs.updateString("tel", this.jTextFieldTel.getText());
                    rs.updateString("school", this.jTextFieldSchool.getText());
                    rs.updateString("weekCount", this.jTextFieldWeekCount.getText());
                    rs.updateString("dateStart", this.jComboBoxYearStart.getSelectedItem().toString() + "."
                            + this.jComboBoxMonthStart.getSelectedItem().toString() + "."
                            + this.jComboBoxDayStart.getSelectedItem().toString());
                    rs.updateString("coursePerWeek", this.jTextFieldCoursePerWeek.getText());
                    rs.updateString("pricePerCourse", this.jTextFieldPricePerCourse.getText());
                    rs.updateString("tuition", this.jTextFieldTuition.getText());
                    rs.updateString("bookFee", this.jTextFieldBookFee.getText());
                    rs.updateString("costumeFee", this.jTextFieldCostumeFee.getText());
                    rs.updateString("otherFee", this.jTextFieldOtherFee.getText());
                    if (rs.getString("sumFee").equals(this.jTextFieldSumFee.getText()) == false) {//总费用发生变化，证明是二次交费
                        rs.updateString("first", "false");//二次交费的标记
                    }
                    rs.updateString("sumFee", this.jTextFieldSumFee.getText());

                    rs.updateRow();

                    JOptionPane.showConfirmDialog(null, "修改成功！", "提示", JOptionPane.CLOSED_OPTION, JOptionPane.INFORMATION_MESSAGE);

                    if (this.parent != null) {//如果父窗口是newToFormal 则需更新右侧列表
                        parent.updateRight();
                    }

                    dispose();
                }
            } catch (SQLException ex) {
                Logger.getLogger(formalStuInputUI.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    private void jButtonJustExitActionPerformed(java.awt.event.ActionEvent evt) {//查询--不修改时的按钮消息
        dispose();//关闭自己
    }

    private void jButtonAddActionPerformed(java.awt.event.ActionEvent evt) {//添加时的按钮消息
        if (stuChooseMethod.hasFormalStu(this.jTextFieldId.getText()) == false) {
            try {
                // TODO add your handling code here:
                newComerInputMethod.deleteNewComer(student); //删除试听生 在更新信息之前删除
                fulfillInfo(); //补上其他信息
                formalStuInputMethod.addFormalStu(student); //添加正式生
                JOptionPane.showConfirmDialog(null, "添加成功！", "提示", JOptionPane.CLOSED_OPTION, JOptionPane.INFORMATION_MESSAGE);
                ///////////////////////////////////////////////////////////////////
                int result = JOptionPane.showConfirmDialog(null, "要打印收据和学生证吗？", "提示", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);
                String filename;
                filename = this.jTextFieldName.getText() + ".xls";
                IdAcountExcel put = new IdAcountExcel(student, filename);
                put.setOutputFile(filename);
                put.write();
                if (result == 0) {
                    PrintTest.print(PrintTest.getPath() + "\\学生证和收据\\" + filename);
                } else {
                    PrintTest.showTable(PrintTest.getPath() + "\\学生证和收据\\" + filename);
                }
                System.out.println("Please check the result file " + PrintTest.getPath() + "\\学生证和收据\\" + filename);
                //////////////////////////////////////////////////////////////////
                //parent.leftToRight(student.id);
                //通过库里的信息进行更新视图
                parent.updateLeft();
                parent.updateRight();
                dispose();
            } catch (IOException ex) {
                Logger.getLogger(formalStuInputUI.class.getName()).log(Level.SEVERE, null, ex);
            } catch (WriteException ex) {
                Logger.getLogger(formalStuInputUI.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else {
            JOptionPane.showConfirmDialog(null, "已存在该学生编码的学生！", "提示", JOptionPane.CLOSED_OPTION, JOptionPane.WARNING_MESSAGE);
            this.jTextFieldId.setSelectionStart(0);
        }
    }

    void initFullInfo() {
        //this.jTextFieldId.setEditable(false);//学号不可修改
        this.jTextFieldId.setText(student.id);
        this.jTextFieldName.setText(student.name);
        this.jComboBoxSex.setSelectedItem(student.sex);
        StringTokenizer st = new StringTokenizer(student.birthday, ".");
        Vector<String> temp = new Vector<String>();
        while (st.hasMoreTokens()) {
            //System.out.println(st.nextToken());
            temp.add(st.nextToken());
        }
        this.jComboBoxYear.setSelectedItem(temp.get(0));
        this.jComboBoxMonth.setSelectedItem(temp.get(1));
        this.jComboBoxDay.setSelectedItem(temp.get(2));
        this.jTextFieldTel.setText(student.tel);
        this.jTextFieldSchool.setText(student.school);

        this.jTextFieldWeekCount.setText(student.weekCount);

        temp.clear();
        st = new StringTokenizer(student.dateStart, ".");
        while (st.hasMoreElements()) {
            temp.add(st.nextToken());
        }
        this.jComboBoxYearStart.setSelectedItem(temp.get(0));
        this.jComboBoxMonthStart.setSelectedItem(temp.get(1));
        this.jComboBoxDayStart.setSelectedItem(temp.get(2));
        this.jTextFieldCoursePerWeek.setText(student.coursePerWeek);
        int weekCount = Integer.valueOf(this.jTextFieldWeekCount.getText());

        int gap = 7 * Integer.valueOf(this.jTextFieldWeekCount.getText());
        int year = Integer.valueOf(this.jComboBoxYearStart.getSelectedItem().toString());
        int month = Integer.valueOf(this.jComboBoxMonthStart.getSelectedItem().toString());
        int day = Integer.valueOf(this.jComboBoxDayStart.getSelectedItem().toString());
        this.jTextFieldEndDate.setText(formalStuInputMethod.getEndDate(year, month, day, gap));


        int coursePerWeek = Integer.valueOf(this.jTextFieldCoursePerWeek.getText());
        int count = weekCount * coursePerWeek;
        this.jTextFieldCount.setText(Integer.toString(count));
        this.jTextFieldPricePerCourse.setText(student.pricePerCourse);
        int pricePerCourse = Integer.valueOf(this.jTextFieldPricePerCourse.getText());
        int tuition = pricePerCourse * count;
        this.jTextFieldTuition.setText(Integer.toString(tuition));
        this.jTextFieldBookFee.setText(student.bookFee);
        this.jTextFieldCostumeFee.setText(student.costumeFee);
        this.jTextFieldOtherFee.setText(student.otherFee);
        int costumeFee = Integer.valueOf(this.jTextFieldCostumeFee.getText());
        int bookFee = Integer.valueOf(this.jTextFieldBookFee.getText());
        int otherFee = Integer.valueOf(this.jTextFieldOtherFee.getText());
        int sumFee = tuition + costumeFee + bookFee + otherFee;
        this.jTextFieldSumFee.setText(Integer.toString(sumFee));
    }

    void initExistInfo() {
        //将student的已有信息显示在界面上
        this.jTextFieldName.setText(student.name);
        this.jComboBoxSex.setSelectedItem(student.sex);
        StringTokenizer st = new StringTokenizer(student.birthday, ".");
        Vector<String> temp = new Vector<String>();
        while (st.hasMoreTokens()) {
            //System.out.println(st.nextToken());
            temp.add(st.nextToken());
        }
        this.jComboBoxYear.setSelectedItem(temp.get(0));
        this.jComboBoxMonth.setSelectedItem(temp.get(1));
        this.jComboBoxDay.setSelectedItem(temp.get(2));
        this.jTextFieldTel.setText(student.tel);
        this.jTextFieldSchool.setText(student.school);
        //自动生成该班当前的最大学号
        String personId;
        String maxId = formalStuInputMethod.getMaxId(student.classCode);
        int pos;
        if (maxId == null) {
            pos = 1;
        } else {
            pos = Integer.valueOf(maxId.substring(7, 9)) + 1;
        }
        if (pos < 10) {
            personId = "0" + Integer.toString(pos);
        } else {
            personId = Integer.toString(pos);
        }
        this.jTextFieldId.setText(student.classCode + personId);
        //System.out.println(formalStuInputMethod.getFormalStuCount(student.classCode));
    }

    void fulfillInfo() {
        //填充一个正式生的所有信息
        student.id = this.jTextFieldId.getText();
        student.name = this.jTextFieldName.getText();
        student.sex = this.jComboBoxSex.getSelectedItem().toString();
        student.birthday = this.jComboBoxYear.getSelectedItem().toString() + "."
                + this.jComboBoxMonth.getSelectedItem().toString() + "."
                + this.jComboBoxDay.getSelectedItem().toString();
        student.tel = this.jTextFieldTel.getText();
        student.school = this.jTextFieldSchool.getText();
        student.weekCount = this.jTextFieldWeekCount.getText();
        student.dateStart = this.jComboBoxYearStart.getSelectedItem().toString() + "."
                + this.jComboBoxMonthStart.getSelectedItem().toString() + "."
                + this.jComboBoxDayStart.getSelectedItem().toString();
        student.coursePerWeek = this.jTextFieldCoursePerWeek.getText();
        student.pricePerCourse = this.jTextFieldPricePerCourse.getText();
        student.tuition = this.jTextFieldTuition.getText();
        student.costumeFee = this.jTextFieldCostumeFee.getText();
        student.bookFee = this.jTextFieldBookFee.getText();
        student.otherFee = this.jTextFieldOtherFee.getText();
        student.sumFee = this.jTextFieldSumFee.getText();
        student.classCode = this.jTextFieldId.getText().substring(0, 7);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelTop = new javax.swing.JPanel();
        jPanelCenter = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabelId = new javax.swing.JLabel();
        jTextFieldId = new javax.swing.JTextField();
        jLabelName = new javax.swing.JLabel();
        jTextFieldName = new javax.swing.JTextField();
        jLabelSex = new javax.swing.JLabel();
        jComboBoxSex = new javax.swing.JComboBox();
        jLabelBirthday = new javax.swing.JLabel();
        jComboBoxYear = new javax.swing.JComboBox();
        jLabelYear = new javax.swing.JLabel();
        jComboBoxMonth = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jComboBoxDay = new javax.swing.JComboBox();
        jLabelDay = new javax.swing.JLabel();
        jLabelTel = new javax.swing.JLabel();
        jTextFieldTel = new javax.swing.JTextField();
        jLabelSchool = new javax.swing.JLabel();
        jTextFieldSchool = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabelWeekCount = new javax.swing.JLabel();
        jTextFieldWeekCount = new javax.swing.JTextField();
        jLabelDateStart = new javax.swing.JLabel();
        jComboBoxYearStart = new javax.swing.JComboBox();
        jLabelYearStart = new javax.swing.JLabel();
        jComboBoxMonthStart = new javax.swing.JComboBox();
        jLabelMonthStart = new javax.swing.JLabel();
        jComboBoxDayStart = new javax.swing.JComboBox();
        jLabelDayStart = new javax.swing.JLabel();
        jButtonGenerateEndDate = new javax.swing.JButton();
        jTextFieldEndDate = new javax.swing.JTextField();
        jSeparator1 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        jPanelBottom = new javax.swing.JPanel();
        jLabelCoursePerWeek = new javax.swing.JLabel();
        jTextFieldCoursePerWeek = new javax.swing.JTextField();
        jButtonGenerateCount = new javax.swing.JButton();
        jTextFieldCount = new javax.swing.JTextField();
        jLabelPricePerCourse = new javax.swing.JLabel();
        jTextFieldPricePerCourse = new javax.swing.JTextField();
        jButtonGenerateTuition = new javax.swing.JButton();
        jLabelCount = new javax.swing.JLabel();
        jLabelTuition = new javax.swing.JLabel();
        jTextFieldTuition = new javax.swing.JTextField();
        jLabelCostumeFee = new javax.swing.JLabel();
        jTextFieldCostumeFee = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabelBookFee = new javax.swing.JLabel();
        jTextFieldBookFee = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabelOtherFee = new javax.swing.JLabel();
        jTextFieldOtherFee = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jButtonGenerateSumFee = new javax.swing.JButton();
        jLabelSumFee = new javax.swing.JLabel();
        jTextFieldSumFee = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabelTitle = new javax.swing.JLabel();
        jSeparator4 = new javax.swing.JSeparator();
        jButtonConfirm = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JSeparator();
        jButtonJustExit = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        javax.swing.GroupLayout jPanelTopLayout = new javax.swing.GroupLayout(jPanelTop);
        jPanelTop.setLayout(jPanelTopLayout);
        jPanelTopLayout.setHorizontalGroup(
            jPanelTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 312, Short.MAX_VALUE)
        );
        jPanelTopLayout.setVerticalGroup(
            jPanelTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 28, Short.MAX_VALUE)
        );

        jLabelId.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelId.setText("学生编码");

        jTextFieldId.setFont(new java.awt.Font("华文细黑", 0, 24));

        jLabelName.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelName.setText("姓名");

        jTextFieldName.setFont(new java.awt.Font("华文细黑", 0, 24));

        jLabelSex.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelSex.setText("性别");

        jComboBoxSex.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jComboBoxSex.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "男", "女" }));

        jLabelBirthday.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelBirthday.setText("出生日期");

        jComboBoxYear.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jComboBoxYear.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1989", "1990", "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016" }));

        jLabelYear.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelYear.setText("年");

        jComboBoxMonth.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jComboBoxMonth.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }));

        jLabel1.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabel1.setText("月");

        jComboBoxDay.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jComboBoxDay.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));

        jLabelDay.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelDay.setText("日");

        jLabelTel.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelTel.setText("家长电话");

        jTextFieldTel.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N

        jLabelSchool.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelSchool.setText("学校");

        jTextFieldSchool.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabelId)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextFieldId, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelName)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldName))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelBirthday)
                            .addComponent(jLabelSchool))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jComboBoxYear, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabelYear)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBoxMonth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBoxDay, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabelDay)
                                .addGap(18, 18, 18)
                                .addComponent(jLabelTel))
                            .addComponent(jTextFieldSchool, javax.swing.GroupLayout.PREFERRED_SIZE, 353, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabelSex)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxSex, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jTextFieldTel, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(42, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jComboBoxDay, jComboBoxMonth});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelId)
                    .addComponent(jTextFieldId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelName)
                    .addComponent(jTextFieldName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelSex)
                    .addComponent(jComboBoxSex, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelBirthday)
                    .addComponent(jComboBoxYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelYear)
                    .addComponent(jComboBoxMonth, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1)
                    .addComponent(jComboBoxDay, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelDay)
                    .addComponent(jLabelTel)
                    .addComponent(jTextFieldTel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelSchool)
                    .addComponent(jTextFieldSchool, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jComboBoxDay, jComboBoxMonth, jComboBoxYear});

        jLabelWeekCount.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelWeekCount.setText("交费周数");

        jTextFieldWeekCount.setFont(new java.awt.Font("华文细黑", 0, 24));

        jLabelDateStart.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelDateStart.setText("交费起始日");

        jComboBoxYearStart.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jComboBoxYearStart.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020" }));

        jLabelYearStart.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelYearStart.setText("年");

        jComboBoxMonthStart.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jComboBoxMonthStart.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }));

        jLabelMonthStart.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelMonthStart.setText("月");

        jComboBoxDayStart.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jComboBoxDayStart.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));

        jLabelDayStart.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelDayStart.setText("日");

        jButtonGenerateEndDate.setFont(new java.awt.Font("华文细黑", 0, 24));
        jButtonGenerateEndDate.setText("生成交费截止日");
        jButtonGenerateEndDate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGenerateEndDateActionPerformed(evt);
            }
        });

        jTextFieldEndDate.setFont(new java.awt.Font("华文细黑", 0, 24));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabelWeekCount)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldWeekCount, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelDateStart)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxYearStart, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelYearStart))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jButtonGenerateEndDate)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextFieldEndDate)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBoxMonthStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelMonthStart)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBoxDayStart, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelDayStart)
                .addContainerGap(134, Short.MAX_VALUE))
        );

        jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jComboBoxDayStart, jComboBoxMonthStart});

        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelWeekCount)
                    .addComponent(jTextFieldWeekCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelDateStart)
                    .addComponent(jComboBoxYearStart, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelYearStart)
                    .addComponent(jComboBoxMonthStart, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelMonthStart)
                    .addComponent(jComboBoxDayStart, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelDayStart))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonGenerateEndDate)
                    .addComponent(jTextFieldEndDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel2Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jComboBoxDayStart, jComboBoxMonthStart, jComboBoxYearStart});

        javax.swing.GroupLayout jPanelCenterLayout = new javax.swing.GroupLayout(jPanelCenter);
        jPanelCenter.setLayout(jPanelCenterLayout);
        jPanelCenterLayout.setHorizontalGroup(
            jPanelCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 910, Short.MAX_VALUE)
            .addGroup(jPanelCenterLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(114, 114, 114))
        );
        jPanelCenterLayout.setVerticalGroup(
            jPanelCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelCenterLayout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jLabelCoursePerWeek.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelCoursePerWeek.setText("每周课次");

        jTextFieldCoursePerWeek.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jTextFieldCoursePerWeek.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldCoursePerWeekActionPerformed(evt);
            }
        });

        jButtonGenerateCount.setFont(new java.awt.Font("华文细黑", 0, 24));
        jButtonGenerateCount.setText("生成总课次");
        jButtonGenerateCount.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGenerateCountActionPerformed(evt);
            }
        });

        jTextFieldCount.setFont(new java.awt.Font("华文细黑", 0, 24));

        jLabelPricePerCourse.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelPricePerCourse.setText("课次单价");

        jTextFieldPricePerCourse.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jTextFieldPricePerCourse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldPricePerCourseActionPerformed(evt);
            }
        });

        jButtonGenerateTuition.setFont(new java.awt.Font("华文细黑", 0, 24));
        jButtonGenerateTuition.setText("生成学费");
        jButtonGenerateTuition.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGenerateTuitionActionPerformed(evt);
            }
        });

        jLabelCount.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelCount.setText("总课次");

        jLabelTuition.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelTuition.setText("学费");

        jTextFieldTuition.setFont(new java.awt.Font("华文细黑", 0, 24));

        jLabelCostumeFee.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelCostumeFee.setText("服装费");

        jTextFieldCostumeFee.setFont(new java.awt.Font("华文细黑", 0, 24));

        jLabel2.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabel2.setText("元");

        jLabel3.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabel3.setText("元");

        jLabelBookFee.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelBookFee.setText("书费");

        jTextFieldBookFee.setFont(new java.awt.Font("华文细黑", 0, 24)); // NOI18N
        jTextFieldBookFee.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldBookFeeActionPerformed(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabel4.setText("元");

        jLabelOtherFee.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelOtherFee.setText("其他费");

        jTextFieldOtherFee.setFont(new java.awt.Font("华文细黑", 0, 24));
        jTextFieldOtherFee.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldOtherFeeActionPerformed(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabel5.setText("元");

        jButtonGenerateSumFee.setFont(new java.awt.Font("华文细黑", 0, 24));
        jButtonGenerateSumFee.setText("生成总收费");
        jButtonGenerateSumFee.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGenerateSumFeeActionPerformed(evt);
            }
        });

        jLabelSumFee.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelSumFee.setText("总收费");

        jTextFieldSumFee.setFont(new java.awt.Font("华文细黑", 0, 24));

        jLabel6.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabel6.setText("元");

        javax.swing.GroupLayout jPanelBottomLayout = new javax.swing.GroupLayout(jPanelBottom);
        jPanelBottom.setLayout(jPanelBottomLayout);
        jPanelBottomLayout.setHorizontalGroup(
            jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBottomLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelBottomLayout.createSequentialGroup()
                        .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelCoursePerWeek)
                            .addComponent(jLabelPricePerCourse)
                            .addComponent(jLabelCostumeFee))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldCoursePerWeek, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldPricePerCourse, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldCostumeFee, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE))
                        .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelBottomLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanelBottomLayout.createSequentialGroup()
                                        .addComponent(jButtonGenerateCount)
                                        .addGap(12, 12, 12)
                                        .addComponent(jLabelCount))
                                    .addGroup(jPanelBottomLayout.createSequentialGroup()
                                        .addComponent(jButtonGenerateTuition)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabelTuition)
                                            .addComponent(jTextFieldSumFee, javax.swing.GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE)
                                            .addComponent(jTextFieldOtherFee, javax.swing.GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE)))))
                            .addGroup(jPanelBottomLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel3)
                                .addGap(33, 33, 33)
                                .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabelSumFee)
                                    .addComponent(jLabelOtherFee)))))
                    .addGroup(jPanelBottomLayout.createSequentialGroup()
                        .addComponent(jButtonGenerateSumFee)
                        .addGap(265, 265, 265)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelBottomLayout.createSequentialGroup()
                        .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jTextFieldTuition, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldCount, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel2))
                    .addGroup(jPanelBottomLayout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addGap(26, 26, 26)
                        .addComponent(jLabelBookFee)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextFieldBookFee, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel4))
                    .addComponent(jLabel6))
                .addGap(82, 82, 82))
        );

        jPanelBottomLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonGenerateCount, jButtonGenerateSumFee, jButtonGenerateTuition});

        jPanelBottomLayout.setVerticalGroup(
            jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBottomLayout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelCoursePerWeek)
                    .addComponent(jTextFieldCoursePerWeek, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonGenerateCount)
                    .addComponent(jTextFieldCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelCount))
                .addGap(18, 18, 18)
                .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPricePerCourse)
                    .addComponent(jTextFieldPricePerCourse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonGenerateTuition)
                    .addComponent(jLabelTuition)
                    .addComponent(jTextFieldTuition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addGap(18, 18, 18)
                .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelCostumeFee)
                    .addComponent(jTextFieldCostumeFee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(jLabelOtherFee)
                    .addComponent(jTextFieldOtherFee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jLabelBookFee)
                    .addComponent(jTextFieldBookFee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonGenerateSumFee)
                    .addComponent(jLabelSumFee)
                    .addComponent(jTextFieldSumFee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanelBottomLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jTextFieldCostumeFee, jTextFieldPricePerCourse});

        jLabelTitle.setFont(new java.awt.Font("华文细黑", 0, 24));
        jLabelTitle.setText("正式生生信息录入");

        jButtonConfirm.setFont(new java.awt.Font("华文细黑", 0, 24));
        jButtonConfirm.setText("确定");

        jButtonJustExit.setFont(new java.awt.Font("华文细黑", 0, 24));
        jButtonJustExit.setText("不修改而关闭");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 788, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(270, 270, 270)
                .addComponent(jLabelTitle)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelTop, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addComponent(jSeparator3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 788, Short.MAX_VALUE)
            .addComponent(jSeparator4, javax.swing.GroupLayout.DEFAULT_SIZE, 788, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addGap(245, 245, 245)
                .addComponent(jButtonConfirm)
                .addGap(18, 18, 18)
                .addComponent(jButtonJustExit)
                .addContainerGap(267, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelBottom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(37, Short.MAX_VALUE))
            .addComponent(jPanelCenter, javax.swing.GroupLayout.DEFAULT_SIZE, 788, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanelTop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelTitle))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4)
                .addComponent(jPanelCenter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelBottom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonJustExit)
                    .addComponent(jButtonConfirm))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonGenerateCountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGenerateCountActionPerformed
        // TODO add your handling code here:
        int weekCount = Integer.valueOf(this.jTextFieldWeekCount.getText());
        int coursePerWeek = Integer.valueOf(this.jTextFieldCoursePerWeek.getText());
        int count = weekCount * coursePerWeek;
        this.jTextFieldCount.setText(Integer.toString(count));
    }//GEN-LAST:event_jButtonGenerateCountActionPerformed

    private void jTextFieldPricePerCourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldPricePerCourseActionPerformed
        // TODO add your handling code here:
        int pricePerCourse = Integer.valueOf(this.jTextFieldPricePerCourse.getText());
        int count = Integer.valueOf(this.jTextFieldCount.getText());
        int tuition = pricePerCourse * count;
        this.jTextFieldTuition.setText(Integer.toString(tuition));
    }//GEN-LAST:event_jTextFieldPricePerCourseActionPerformed

    private void jTextFieldCoursePerWeekActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCoursePerWeekActionPerformed
        // TODO add your handling code here:
        int weekCount = Integer.valueOf(this.jTextFieldWeekCount.getText());
        int coursePerWeek = Integer.valueOf(this.jTextFieldCoursePerWeek.getText());
        int count = weekCount * coursePerWeek;
        this.jTextFieldCount.setText(Integer.toString(count));
    }//GEN-LAST:event_jTextFieldCoursePerWeekActionPerformed

    private void jButtonGenerateTuitionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGenerateTuitionActionPerformed
        // TODO add your handling code here:
        int pricePerCourse = Integer.valueOf(this.jTextFieldPricePerCourse.getText());
        int count = Integer.valueOf(this.jTextFieldCount.getText());
        int tuition = pricePerCourse * count;
        this.jTextFieldTuition.setText(Integer.toString(tuition));
    }//GEN-LAST:event_jButtonGenerateTuitionActionPerformed

    private void jTextFieldOtherFeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldOtherFeeActionPerformed
        // TODO add your handling code here:
        int tuition = Integer.valueOf(this.jTextFieldTuition.getText());
        int costumeFee = Integer.valueOf(this.jTextFieldCostumeFee.getText());
        int bookFee = Integer.valueOf(this.jTextFieldBookFee.getText());
        int otherFee = Integer.valueOf(this.jTextFieldOtherFee.getText());
        int sumFee = tuition + costumeFee + bookFee + otherFee;
        this.jTextFieldSumFee.setText(Integer.toString(sumFee));
    }//GEN-LAST:event_jTextFieldOtherFeeActionPerformed

    private void jButtonGenerateEndDateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGenerateEndDateActionPerformed
        // TODO add your handling code here:
        int gap = 7 * Integer.valueOf(this.jTextFieldWeekCount.getText());
        int year = Integer.valueOf(this.jComboBoxYearStart.getSelectedItem().toString());
        int month = Integer.valueOf(this.jComboBoxMonthStart.getSelectedItem().toString());
        int day = Integer.valueOf(this.jComboBoxDayStart.getSelectedItem().toString());
        this.jTextFieldEndDate.setText(formalStuInputMethod.getEndDate(year, month, day, gap));
    }//GEN-LAST:event_jButtonGenerateEndDateActionPerformed

    private void jButtonGenerateSumFeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGenerateSumFeeActionPerformed
        // TODO add your handling code here:
        int tuition = Integer.valueOf(this.jTextFieldTuition.getText());
        int costumeFee = Integer.valueOf(this.jTextFieldCostumeFee.getText());
        int bookFee = Integer.valueOf(this.jTextFieldBookFee.getText());
        int otherFee = Integer.valueOf(this.jTextFieldOtherFee.getText());
        int sumFee = tuition + costumeFee + bookFee + otherFee;
        this.jTextFieldSumFee.setText(Integer.toString(sumFee));
    }//GEN-LAST:event_jButtonGenerateSumFeeActionPerformed

    private void jTextFieldBookFeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldBookFeeActionPerformed
        // TODO add your handling code here:
        int tuition = Integer.valueOf(this.jTextFieldTuition.getText());
        int costumeFee = Integer.valueOf(this.jTextFieldCostumeFee.getText());
        int bookFee = Integer.valueOf(this.jTextFieldBookFee.getText());
        int otherFee = Integer.valueOf(this.jTextFieldOtherFee.getText());
        int sumFee = tuition + costumeFee + bookFee + otherFee;
        this.jTextFieldSumFee.setText(Integer.toString(sumFee));
    }//GEN-LAST:event_jTextFieldBookFeeActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*   java.awt.EventQueue.invokeLater(new Runnable() {
        
        public void run() {
        formalStuInputUI dialog = new formalStuInputUI(new javax.swing.JFrame(), true);
        dialog.addWindowListener(new java.awt.event.WindowAdapter() {
        
        public void windowClosing(java.awt.event.WindowEvent e) {
        System.exit(0);
        }
        });
        dialog.setVisible(true);
        }
        });*/
        String id = "01";
        System.out.println(Integer.toString((Integer.valueOf(id) + 1)));
        Vector<String> temp = new Vector<String>();
        System.out.println(temp.size());
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonConfirm;
    private javax.swing.JButton jButtonGenerateCount;
    private javax.swing.JButton jButtonGenerateEndDate;
    private javax.swing.JButton jButtonGenerateSumFee;
    private javax.swing.JButton jButtonGenerateTuition;
    private javax.swing.JButton jButtonJustExit;
    private javax.swing.JComboBox jComboBoxDay;
    private javax.swing.JComboBox jComboBoxDayStart;
    private javax.swing.JComboBox jComboBoxMonth;
    private javax.swing.JComboBox jComboBoxMonthStart;
    private javax.swing.JComboBox jComboBoxSex;
    private javax.swing.JComboBox jComboBoxYear;
    private javax.swing.JComboBox jComboBoxYearStart;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabelBirthday;
    private javax.swing.JLabel jLabelBookFee;
    private javax.swing.JLabel jLabelCostumeFee;
    private javax.swing.JLabel jLabelCount;
    private javax.swing.JLabel jLabelCoursePerWeek;
    private javax.swing.JLabel jLabelDateStart;
    private javax.swing.JLabel jLabelDay;
    private javax.swing.JLabel jLabelDayStart;
    private javax.swing.JLabel jLabelId;
    private javax.swing.JLabel jLabelMonthStart;
    private javax.swing.JLabel jLabelName;
    private javax.swing.JLabel jLabelOtherFee;
    private javax.swing.JLabel jLabelPricePerCourse;
    private javax.swing.JLabel jLabelSchool;
    private javax.swing.JLabel jLabelSex;
    private javax.swing.JLabel jLabelSumFee;
    private javax.swing.JLabel jLabelTel;
    private javax.swing.JLabel jLabelTitle;
    private javax.swing.JLabel jLabelTuition;
    private javax.swing.JLabel jLabelWeekCount;
    private javax.swing.JLabel jLabelYear;
    private javax.swing.JLabel jLabelYearStart;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanelBottom;
    private javax.swing.JPanel jPanelCenter;
    private javax.swing.JPanel jPanelTop;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JTextField jTextFieldBookFee;
    private javax.swing.JTextField jTextFieldCostumeFee;
    private javax.swing.JTextField jTextFieldCount;
    private javax.swing.JTextField jTextFieldCoursePerWeek;
    private javax.swing.JTextField jTextFieldEndDate;
    private javax.swing.JTextField jTextFieldId;
    private javax.swing.JTextField jTextFieldName;
    private javax.swing.JTextField jTextFieldOtherFee;
    private javax.swing.JTextField jTextFieldPricePerCourse;
    private javax.swing.JTextField jTextFieldSchool;
    private javax.swing.JTextField jTextFieldSumFee;
    private javax.swing.JTextField jTextFieldTel;
    private javax.swing.JTextField jTextFieldTuition;
    private javax.swing.JTextField jTextFieldWeekCount;
    // End of variables declaration//GEN-END:variables
}
